package Main;

import compFile.compareFile;
import dbConn.DBconn;

public class cmpFileThread implements Runnable{ // 实现Runnable接口
    public void run()
    {  // 覆写run()方法
        System.out.println("cmpFileThread stared...");
		String strBaseVersionDir     = "/Users/xianglin/lynnxiang/testPrj/test_fileComp/giveda-GOSP-V1.0.1";
		String strCompareVersionDir  = "/Users/xianglin/lynnxiang/testPrj/test_fileComp/giveda-GOSP-V2.0.2";
		String strResultVersionDir  = "/Users/xianglin/lynnxiang/testPrj/test_fileComp/outbase.txt";
		partCmpFileTest(strBaseVersionDir, strCompareVersionDir, strResultVersionDir);
    }
    
	public static void partCmpFileTest(String baseDir, String cmpDir, String resDir)
	{
		Long startTime = System.currentTimeMillis();
		//DBconn.init();
		compareFile.testCode(baseDir, cmpDir, resDir);
		String sqlString = "insert into version_compare VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
		System.out.println("listJson = " + compareFile.listJson.size());
		Long startTime2 = System.currentTimeMillis();
		DBconn.insertSql(sqlString, compareFile.listJson, 100);
		//DBconn.closeConn();
		Long endTime = System.currentTimeMillis();
		System.out.println("main end, times = " + (endTime - startTime2));
		System.out.println("main end, times = " + (endTime - startTime));
	
	}
};
